//
//  BLChatController.m
//  Byelone
//
//  Created by 乔小乔 on 2020/12/14.
//

#import "BLChatController.h"
#import "BLChatList_Cell.h"
static NSString *reuse_BLChatList_Cell = @"Reuse_BLChatList_Cell";
@interface BLChatController ()<UITableViewDelegate,UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UITableView *tableViewList;
@property (weak, nonatomic) IBOutlet UIView *viewAction;

@end

@implementation BLChatController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor chColorWithHexString:@"#FAFAFA"];
//    [self createLeftBar];
    [self createUI];
}
- (void)createLeftBar{
    [self setLeftTitle:@"聊天室" imgShow:NO backImg:@""];
    UIView *viewLine = [[UIView alloc]initWithFrame:CGRectMake(0, 0, BL_WINDOW_WIDTH, 1)];
    viewLine.backgroundColor = [UIColor chColorWithHexString:@"#EEEEEE"];
    [self.view addSubview:viewLine];
}

- (IBAction)clickTopAction:(UIButton *)sender {
//    101,102,103,104
}
- (void)createUI{
    [self.tableViewList registerNib:[UINib nibWithNibName:@"BLChatList_Cell" bundle:nil] forCellReuseIdentifier:reuse_BLChatList_Cell];
    self.tableViewList.backgroundColor = [UIColor clearColor];
    self.tableViewList.separatorStyle = UITableViewCellSeparatorStyleNone;
    
    if (@available(iOS 11.0, *)) {
        self.tableViewList.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
    }else{
        self.automaticallyAdjustsScrollViewInsets = NO;
    }
    self.viewAction.layer.borderColor = [UIColor chColorWithHexString:@"#080604" alpha:0.07].CGColor;
    self.viewAction.layer.borderWidth = 1;
    [self.viewAction setShadowRadius:3 color:[UIColor chColorWithHexString:@"#080604" alpha:0.07] offset:CGSizeMake(0, 0) opacity:1];
    self.viewAction.layer.cornerRadius = 6;
    self.tableViewList.tableFooterView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, BL_WINDOW_WIDTH, 20)];

}
#pragma mark - delegate
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 10;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    BLChatList_Cell *cell = [tableView dequeueReusableCellWithIdentifier:reuse_BLChatList_Cell forIndexPath:indexPath];
    
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 89;
}

@end
